package com.eam.job.service.impl;

import com.eam.core.utils.DateUtils;
import com.eam.job.domain.EamClassify;
import com.eam.job.mapper.EamClassifyMapper;
import com.eam.job.service.IEamClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分类Service业务层处理
 * 
 * @author eam
 * @date 2022-03-23
 */
@Service
public class EamClassifyServiceImpl implements IEamClassifyService 
{
    @Autowired
    private EamClassifyMapper eamClassifyMapper;

    /**
     * 查询分类
     * 
     * @param classifyId 分类主键
     * @return 分类
     */
    @Override
    public EamClassify selectEamClassifyByClassifyId(Long classifyId)
    {
        return eamClassifyMapper.selectEamClassifyByClassifyId(classifyId);
    }

    /**
     * 查询分类列表
     * 
     * @param eamClassify 分类
     * @return 分类
     */
    @Override
    public List<EamClassify> selectEamClassifyList(EamClassify eamClassify)
    {
        return eamClassifyMapper.selectEamClassifyList(eamClassify);
    }

    /**
     * 新增分类
     * 
     * @param eamClassify 分类
     * @return 结果
     */
    @Override
    public int insertEamClassify(EamClassify eamClassify)
    {
        eamClassify.setCreateTime(DateUtils.getNowDate());
        return eamClassifyMapper.insertEamClassify(eamClassify);
    }

    /**
     * 修改分类
     * 
     * @param eamClassify 分类
     * @return 结果
     */
    @Override
    public int updateEamClassify(EamClassify eamClassify)
    {
        eamClassify.setUpdateTime(DateUtils.getNowDate());
        return eamClassifyMapper.updateEamClassify(eamClassify);
    }

    /**
     * 批量删除分类
     * 
     * @param classifyIds 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteEamClassifyByClassifyIds(Long[] classifyIds)
    {
        return eamClassifyMapper.deleteEamClassifyByClassifyIds(classifyIds);
    }

    /**
     * 删除分类信息
     * 
     * @param classifyId 分类主键
     * @return 结果
     */
    @Override
    public int deleteEamClassifyByClassifyId(Long classifyId)
    {
        return eamClassifyMapper.deleteEamClassifyByClassifyId(classifyId);
    }
}
